package com.example.guava;

import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ListMultimap;

import java.util.List;

/**
 * 4.Multimaps多值映射数据结构，它允许一个键对应多个值
 */
public class MultimapsDemo {
    public static void main(String[] args) {
        ListMultimap<Integer, String> map = ArrayListMultimap.create();
        map.put(1, "a");
        map.put(1, "b");
        List<String> values = map.get(1);
        System.out.println(values);

    }
}
